#pragma once

#include <thread>
#include <string>
#include <memory>
#include <chrono>
#include <mutex>
#include <future>
#include <unistd.h>
#include <condition_variable>
#include "AbstractNode.h"
#include "base/Define.h"
#include "base/Bytes.h"
 

namespace zeroplus::mq
{
    class PairNode : public AbstractNode
    {
    public:
        PairNode(const std::string &uri, const ConnectType &connectType)
        {
            CreateConnection(zmqpp::socket_type::pair, uri, connectType);
        }

        ~PairNode()
        {
        }

        Bytes InvokeSync(const Bytes &message)
        {
            Send(message);
            auto msg = Recv();
            return msg;
        }

        bool Send(const Bytes &message);

        Bytes Recv();
    };
}
